<?php
$conn=mysql_connect ($server,$mysql_name,$mysql_pass); 
mysql_query("SET NAMES 'gbk'",$conn); 
if(!mysql_select_db($dbname))
{echo "数据库连接失败";
}
?>